<html>
	<head>
		<script type="text/javascript" src="<?=base_url()?>quintedirect/jquery.js" ></script>
		<script type="text/javascript">
			
			$(document).ready(function(){
				
				//hide the submenus
				$(".submenu").hide();
				
				//expand the menu where we are, if there are submenus
				$(".<?=$location?>menu").show();
				
				<?php foreach($pages as $page) { ?>
					<?php if ($page->parent == 0) { ?>
						$("#<?=$page->slug?>").click(function() {
							$("#content").load('<?=base_url() . "index.php/welcome/apage/" . $page->slug?>');
							
							<?php if($page->slug == 'homepage') { ?>
								$("#graphic").show();
							<?php } else { ?>
								$("#graphic").hide('slow');
							<?php } ?>
							
							$(".submenu").hide();
							$(".<?=$page->slug?>menu").show('slow');
							return false;
						});
					<?php } ?>
				<?php } ?>
				
				<?php foreach ($categories as $category) { ?>
					//click event for each category
					$('.cat<?=$category->catid?>').click(function() {
						//hide the splash graphic
						$("#graphic").hide('slow');
						
						//swooshily hide the categories
						$('.productsmenu').slideUp('fast');
						
						//load in the child categories
						$('#categories').load('<?=base_url()?>index.php/category/acatlist/<?=$category->catid?>');
						
						//show the categories again
						$('.productsmenu').slideDown('slow');
						
						//put some products in the content area
						$('#content').load('<?=base_url()?>index.php/category/acat/<?=$category->catid?>');
						
						return false;
					});
				<?php } ?>
				
				
			});
			
		</script>
			

		<title>
			Quinte Direct
		</title>
		<link rel="stylesheet" href="<?=base_url()?>quintedirect/style.css">
	</head>
	<body>
	<div id="page">
		<h1>
			
			<img src="<?=base_url()?>quintedirect/logo.gif" id="logo" alt="Quinte Direct" />
			<span><a href="">Shopping Cart</a> | <a href="">My Account</a></span>
		</h1>
		<div id="sidebar">
		
			<ul id="pages">
				<li>Search:<br /><input size="18"/> GO</li>
				<?php foreach ($pages as $page) { 
					if ($page->parent == 0) {
						echo '<li id="';
						echo $page->slug;
						echo '">&raquo; <a href="' . base_url() . 'index.php/welcome/page/' . $page->slug . '">';
						echo $page->slug == 'homepage' ? 'Home' : $page->title;
						echo '</a></li>';
						
						//now for this guy's children
						foreach ($pages as $subpage) {
							if ($subpage->parent == $page->id) {
								echo '<li class="submenu ';
								echo $page->slug . 'menu';
								echo '" id="';
								echo $subpage->slug;
								echo '">&nbsp; &nbsp; &raquo; <a href="' . base_url() . 'index.php/welcome/page/' . $subpage->slug . '">';
								echo $subpage->title;
								echo '</a></li>';
							}
						}
					}
				} ?>
				<!--li class="current" id="homepage">&raquo; <a href="<?=base_url()?>">Home</a></li>
				<li id="aboutus">&raquo; <a href="?p=aboutus&m=aboutus">About Us</a></li>
					<li class="submenu aboutusmenu" id="careers">&nbsp; &nbsp; &raquo; <a href="?p=careers&m=aboutus">Careers</a></li>
					<li class="submenu aboutusmenu" id="ourgoal">&nbsp; &nbsp; &raquo; <a href="?p=ourgoal&m=aboutus">Our Goal</a></li>
					<li class="submenu aboutusmenu" id="ourpromise">&nbsp; &nbsp; &raquo; <a href="?p=ourpromise&m=aboutus">Our Promise</a></li>
				<li id="ourservices">&raquo; <a href="?p=ourservices&m=ourservices">Our Services</a></li>
					<li class="submenu ourservicesmenu" id="delivery">&nbsp; &nbsp; &raquo; <a href="?p=delivery&m=ourservices">Delivery</a></li>
					<li class="submenu ourservicesmenu" id="faxandcopy">&nbsp; &nbsp; &raquo; <a href="?p=faxandcopy&m=ourservices">Fax and Copy</a></li>
					<li class="submenu ourservicesmenu" id="printing">&nbsp; &nbsp; &raquo; <a href="?p=printing&m=ourservices">Printing</a></li>
					<li class="submenu ourservicesmenu" id="laserphotoprints">&nbsp; &nbsp; &raquo; <a href="?p=laserphotoprints&m=ourservices">Laser Photo Prints</a></li>
					<li class="submenu ourservicesmenu" id="recycling">&nbsp; &nbsp; &raquo; <a href="?p=recycling&m=ourservices">Recycling Program</a></li>
				<li id="howtoshop">&raquo; <a href="?p=howtoshop&m=howtoshop">How to Shop</a></li>
					<li class="submenu howtoshopmenu" id="contact">&nbsp; &nbsp; &raquo; <a href="?p=contact&m=howtoshop">Contact</a></li>
					<li class="submenu howtoshopmenu" id="placeanorder">&nbsp; &nbsp; &raquo; <a href="?p=placeanorder&m=howtoshop">Place an Order</a></li>
					<li class="submenu howtoshopmenu" id="howtopay">&nbsp; &nbsp; &raquo; <a href="?p=howtopay&m=howtoshop">How to Pay</a></li-->
				
			</ul>
			<h2>
				<a href="<?=base_url()?>index.php/">Categories</a>
			</h2>
			<ul id="categories">
				<li>^ <a href="<?=base_url()?>index.php/">Top Level</a></li>
				<!-- top level link -->
				
			<?php foreach ($categories as $category) { ?>
				<?php if ($category->parentid == -1) { ?>
				<li class="productsmenu cat<?=$category->catid?>">&raquo; <a href="<?=base_url()?>index.php/category/cat/<?=$category->catid?>"><?=$category->catname?></a></li>
			<?php }} ?>

			</ul>
			
		</div>
		<div id="splash">
			<?= $location == 'homepage' || empty($location) ? '<center><img id="graphic" src="' . base_url() . 'quintedirect/headers/' . rand(1,4) . '.jpg" /></center>' : '' ?>
			<!--div id="didyouknow">
				Soon you will be able to buy products right from this website! Until then, you can order by phone or email.
			</div>
			<div id="search">
				<b>Coming Soon!</b>
			</div-->
		</div>
		<div id="content">
			<h2><?=$title?></h2>
			<?=$content?>
			
			
		</div>
		<div id="footer">
			<a href="?p=homepage">Home</a> | <a href="?p=missionstatement">Mission Statement</a> | <a href="?p=warrantyreturns">Warranty & Returns</a> | <a href="?p=faq">FAQ</a> | <a href="?p=disclaimer">Disclaimer</a> | <a href="?p=termsconditions">Terms & Conditions</a> | <a href="?p=contact">Contact Us</a> | <a href="?p=privacy">Privacy Policy</a><br /><span id="copyright">Copyright &copy; 2008-2009 Quinte Direct</span>
	<br />&nbsp;<br /><center><a href="http://www.bombasticsoftware.com"><img  border="0" src="<?=base_url()?>quintedirect/bombastic.gif" /></a></center>	
	</div>
		
	</div>
	</body>
</html>